const {get_others} = require('../../../Class/GetOthers.js');
const getOthers = new get_others();
Page({
  data: {},
  onLoad(options) {
    wx.showLoading({
      title: '数据通信中',
      mask: true
    })
    const wencui_data = JSON.parse(options.wencui_data)
    const filteredVideo = wencui_data.video.filter(v => v.url !== "");
    const navbarHeight = getOthers.Set_navbar()
    this.setData({
      wencui_data: { ...wencui_data, video: filteredVideo },
      navbarHeight
    });
    wx.hideLoading()
  },
  GoBack(e) {
    wx.navigateBack({
      delta: 1
    })
  },
  PlayVideo(e) {
    const id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/wencui/playvideo/playvideo?url='+this.data.wencui_data.video[id].url,
    })
  },
});